import { createZodDto } from 'nestjs-zod';
import { z } from 'zod';

export const CreateOrderRequestSchema = z.object({
  address: z.string(),
  description: z.string().optional(),
  count: z.number().default(1),
  items: z.array(
    z.object({
      id: z.number(),
      quantity: z.number().default(1),
    }),
  ),
});

export type CreateOrderRequest = z.infer<typeof CreateOrderRequestSchema>;
export class CreateOrderDto extends createZodDto(CreateOrderRequestSchema) {}
